package me.tonywang.aop;


import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * Created by Administrator on 2017/11/3.
 */
public class WatchMethodInterceptor implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        Method method =  methodInvocation.getMethod();
        System.out.println("WatchMethodInterceptor >>> " + method.toGenericString());
        Object[] args =  methodInvocation.getArguments();
        System.out.println(Arrays.toString(args));
        return methodInvocation.proceed();
    }
}
